package com.lenovo.lcdm.dcm.common.util;

import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
import com.lenovo.lcdm.common.exception.BusinessException;

/**
 * @Auther xujing30
 * @Date 2024/01/24
 * @Description
 */
public class S3Util {
    public static String getNextId() {
        String sql = "select nextval('dcm_attachment_id_seq')";
        Object id = SqlRunner.db().selectObj(sql);
        if(id == null){
            throw new BusinessException("cannot find attachment id sequence.");
        }
        return id.toString();
    }
}
